Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MetaDataAPI V2 #266

Merged
merged 38 commits into from
Jul 2, 2024
Merged

MetaDataAPI V2 #266

merged 38 commits into from
Jul 2, 2024

Conversation

ArdenHide
Copy link
Member

No description provided.

- update `DynamicTypeBuilder`
- update `PropertyInfo`
- update `Metadata()`
- remove logic for adding providers
- firts implementation of `AttributesProvider`
- add `Erc721AttributeAttribute`
- remove abstract `DescriptionSource` from `PoolInfo` (use `this`)
- bugfix on PoolInfo object created
- add more providers
@ArdenHide
Copy link
Member Author

ArdenHide commented Jun 24, 2024

Let's close issues here: https://github.com/ArdenHide/NethereumGenerator/issues

Then we can update our package https://github.com/The-Poolz/poolz.finance.csharp.contracts using the newest version of "ArdenHide/NethereumGenerator"

It's need to possible create service which can use LockDealNFTService as dependencies and reperesent two functions FetchPoolInfo and IsPoolIdInSupplyRange.

P.S. Right now it is impossible to create a "correct", testable class. It is possible to use the DI pattern by passing LockDealNFTService to a method, but it is preferable to use the class constructor to receive LockDealNFTService as a dependency.

P.S.S. The ideal result is that there is no need to create a wrapper class, and we can directly use ILockDealNFTService as a dependency.

@ArdenHide
Copy link
Member Author

ArdenHide commented Jun 24, 2024

Create saved lambda requests with folow format:

Example of file name: chainId 56 - poolId 0 - deal provider

{
  "Description": "Write here what is expected for this request",
  "queryStringParameters": {
    "poolId": 0,
    "chainId": 97
  }
}

- fix second parameter for LambdaHandler
- rename `private static` member in `DefaultServiceProvider`
- use `GetRequiredService` instead of `GetService` and throwing custom exception
- use 1.0.4 version of `poolz.finance.csharp.contracts` package
- write `LockDealNftServiceExtensions`
- register `ILockDealNFTService` service in `AbstractProvider`
- typo for required services in `AbstractProvider`
- remove `FetchPoolInfo` from `AbstractProvider`
- update `CollateralProvider` using new extensions method
- register `ILockDealNFTService` service in `LambdaFunction`
- add new extension method `IsPoolIdInSupplyRange` for `ILockDealNFTService`
- beautify error message for `ChainNotSupportedResponse`
- create `PoolIdNotInSupplyRangeResponse`
@ArdenHide ArdenHide marked this pull request as ready for review June 28, 2024 10:47
ArdenHide added 5 commits July 1, 2024 11:18
* - write `DateTimeExtensionsTests`
- save not-working `LockDealNftServiceExtensionsTests`

* - tests for `FetchPoolInfo` methods from `LockDealNftServiceExtensions`

* - bugfix for `LambdaRequestValidator`
- write tests for `LambdaRequestValidator`

* - write tests for `LambdaRequest`

* - fix `IsPoolIdInSupplyRange` tests

* - code cleanup
- enhancement code for tests
- add `Erc20Provider` tests
- add `Erc20Token` tests
* - write `DateTimeExtensionsTests`
- save not-working `LockDealNftServiceExtensionsTests`

* - tests for `FetchPoolInfo` methods from `LockDealNftServiceExtensions`

* - bugfix for `LambdaRequestValidator`
- write tests for `LambdaRequestValidator`

* - write tests for `LambdaRequest`

* - fix `IsPoolIdInSupplyRange` tests

* - code cleanup
- enhancement code for tests
- add `Erc20Provider` tests
- add `Erc20Token` tests

* - remove CW of metadata

* - add `DbChainManager`
- use `DbChainManager` as default `IChainManager`

* - refactor `DbChainManager`
- remove `LocalChainManager`

* - use prod DB

* Update coverage-report.yml

* Update coverage-report.yml
@ArdenHide
Copy link
Member Author

ArdenHide commented Jul 1, 2024

New format of description:

ChainId: 4503599627370476, PoolId: 4503599627370476, Hash: HASH_OF_PARAMS_HERE

Hash format: $"{ChainId}-{PoolId}-{VaultId}-{Params}".ToSha256()

* - update `GetImage()`
- use 1.0.3 version of `TLY.ShortUrl` package

* Update .gitignore

* - update .csproj

* - cleanup

* - use ternary operator
Copy link

github-actions bot commented Jul 2, 2024

Diagrams

Diagrams summary
URL PATH
include URL ./diagrams/include.puml
DefaultServiceProvider URL ./diagrams/src/MetaDataAPI/DefaultServiceProvider.puml
LambdaFunction URL ./diagrams/src/MetaDataAPI/LambdaFunction.puml
Environments URL ./diagrams/src/MetaDataAPI/Environments.puml
ValidationErrorResponse URL ./diagrams/src/MetaDataAPI/Response/ValidationErrorResponse.puml
SuccessResponse URL ./diagrams/src/MetaDataAPI/Response/SuccessResponse.puml
PoolIdNotInSupplyRangeResponse URL ./diagrams/src/MetaDataAPI/Response/PoolIdNotInSupplyRangeResponse.puml
GeneralErrorResponse URL ./diagrams/src/MetaDataAPI/Response/GeneralErrorResponse.puml
ChainNotSupportedResponse URL ./diagrams/src/MetaDataAPI/Response/ChainNotSupportedResponse.puml
LambdaResponse URL ./diagrams/src/MetaDataAPI/Response/LambdaResponse.puml
LambdaRequest URL ./diagrams/src/MetaDataAPI/Request/LambdaRequest.puml
LambdaRequestValidator URL ./diagrams/src/MetaDataAPI/Validation/LambdaRequestValidator.puml
DbChainManager URL ./diagrams/src/MetaDataAPI/Services/ChainsInfo/DbChainManager.puml
ChainInfo URL ./diagrams/src/MetaDataAPI/Services/ChainsInfo/ChainInfo.puml
IChainManager URL ./diagrams/src/MetaDataAPI/Services/ChainsInfo/IChainManager.puml
Erc20Provider URL ./diagrams/src/MetaDataAPI/Services/Erc20/Erc20Provider.puml
IErc20Provider URL ./diagrams/src/MetaDataAPI/Services/Erc20/IErc20Provider.puml
Erc20Token URL ./diagrams/src/MetaDataAPI/Services/Erc20/Erc20Token.puml
LockDealNftServiceExtensions URL ./diagrams/src/MetaDataAPI/Extensions/LockDealNftServiceExtensions.puml
DateTimeExtensions URL ./diagrams/src/MetaDataAPI/Extensions/DateTimeExtensions.puml
DealProvider URL ./diagrams/src/MetaDataAPI/Providers/DealProvider.puml
AbstractProvider URL ./diagrams/src/MetaDataAPI/Providers/AbstractProvider.puml
TimedDealProvider URL ./diagrams/src/MetaDataAPI/Providers/TimedDealProvider.puml
LockDealProvider URL ./diagrams/src/MetaDataAPI/Providers/LockDealProvider.puml
CollateralProvider URL ./diagrams/src/MetaDataAPI/Providers/CollateralProvider.puml
RefundProvider URL ./diagrams/src/MetaDataAPI/Providers/RefundProvider.puml
DelayVaultProvider URL ./diagrams/src/MetaDataAPI/Providers/DelayVaultProvider.puml
Erc721Metadata URL ./diagrams/src/MetaDataAPI/Providers/Attributes/Erc721Metadata.puml
DisplayType URL ./diagrams/src/MetaDataAPI/Providers/Attributes/DisplayType.puml
Erc721MetadataItem URL ./diagrams/src/MetaDataAPI/Providers/Attributes/Erc721MetadataItem.puml
Erc721MetadataItemAttribute URL ./diagrams/src/MetaDataAPI/Providers/Attributes/Erc721MetadataItemAttribute.puml
UrlifyProvider URL ./diagrams/src/MetaDataAPI/Providers/Image/UrlifyProvider.puml
QueryStringToken URL ./diagrams/src/MetaDataAPI/Providers/Image/QueryStringToken.puml
LambdaRequestTests URL ./diagrams/tests/MetaDataAPI.Tests/Request/LambdaRequestTests.puml
LambdaRequestValidatorTests URL ./diagrams/tests/MetaDataAPI.Tests/Validation/LambdaRequestValidatorTests.puml
Erc20ProviderTests URL ./diagrams/tests/MetaDataAPI.Tests/Services/Erc20/Erc20ProviderTests.puml
Erc20TokenTests URL ./diagrams/tests/MetaDataAPI.Tests/Services/Erc20/Erc20TokenTests.puml
LockDealNftServiceExtensionsTests URL ./diagrams/tests/MetaDataAPI.Tests/Extensions/LockDealNftServiceExtensionsTests.puml
DateTimeExtensionsTests URL ./diagrams/tests/MetaDataAPI.Tests/Extensions/DateTimeExtensionsTests.puml

Copy link

github-actions bot commented Jul 2, 2024

Summary

Summary
Generated on: 07/02/2024 - 14:53:50
Coverage date: 07/02/2024 - 14:53:50
Parser: Cobertura
Assemblies: 1
Classes: 28
Files: 28
Line coverage: 25.3% (97 of 383)
Covered lines: 97
Uncovered lines: 286
Coverable lines: 383
Total lines: 844
Branch coverage: 17.6% (6 of 34)
Covered branches: 6
Total branches: 34
Method coverage: Feature is only available for sponsors

Coverage

MetaDataAPI - 25.3%
Name Line Branch
MetaDataAPI 25.3% 17.6%
MetaDataAPI.DefaultServiceProvider 0% 0%
MetaDataAPI.Extensions.DateTimeExtensions 100%
MetaDataAPI.Extensions.LockDealNftServiceExtensions 100%
MetaDataAPI.LambdaFunction 0% 0%
MetaDataAPI.Providers.AbstractProvider 0% 0%
MetaDataAPI.Providers.Attributes.Erc721Metadata 0%
MetaDataAPI.Providers.Attributes.Erc721MetadataItem 0%
MetaDataAPI.Providers.Attributes.Erc721MetadataItemAttribute 0%
MetaDataAPI.Providers.CollateralProvider 0%
MetaDataAPI.Providers.DealProvider 0%
MetaDataAPI.Providers.DelayVaultProvider 0%
MetaDataAPI.Providers.Image.QueryStringToken 0%
MetaDataAPI.Providers.Image.UrlifyProvider 0% 0%
MetaDataAPI.Providers.LockDealProvider 0%
MetaDataAPI.Providers.RefundProvider 0%
MetaDataAPI.Providers.TimedDealProvider 0%
MetaDataAPI.Request.LambdaRequest 100% 100%
MetaDataAPI.Response.ChainNotSupportedResponse 0%
MetaDataAPI.Response.GeneralErrorResponse 0%
MetaDataAPI.Response.LambdaResponse 0% 0%
MetaDataAPI.Response.PoolIdNotInSupplyRangeResponse 0%
MetaDataAPI.Response.SuccessResponse 0%
MetaDataAPI.Response.ValidationErrorResponse 0% 0%
MetaDataAPI.Services.ChainsInfo.ChainInfo 100%
MetaDataAPI.Services.ChainsInfo.DbChainManager 0%
MetaDataAPI.Services.Erc20.Erc20Provider 100%
MetaDataAPI.Services.Erc20.Erc20Token 100%
MetaDataAPI.Validation.LambdaRequestValidator 100%

@Lomet Lomet merged commit 6f9b6a1 into master Jul 2, 2024
4 of 5 checks passed
@Lomet Lomet deleted the meta-data-api-v2 branch July 2, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants